class QuadraticEquation:
    def __init__(self,a,b,c):
        self.__a = a
        self.__b = b
        self.__c = c

    def getA(self):
        return self.__a
    def getB(self):
        return self.__b

    def getC(self):
        return self.__c

    def getDescriminant(self):
        return self.getB()**2 - 4*self.getA()*self.getC()

    def getRoot1(self):
        if self.getDescriminant()>=0:
            return (-1*self.getB() + self.getDescriminant()**0.5 ) / (2*self.getA())
        else:
            return 0

    def getRoot2(self):
        if self.getDescriminant()>=0:
            return (-1*self.getB() - self.getDescriminant()**0.5 ) / (2*self.getA())
        else:
            return 0

def main():

    q = QuadraticEquation(1.0,3,1)
    print("root1:",q.getRoot1(),",root2=",q.getRoot2())
    q = QuadraticEquation(1.0,2.0, 1)
    print("root1:", q.getRoot1(), ",root2=", q.getRoot2())
    q = QuadraticEquation(1.0, 2, 3)
    print("root1:", q.getRoot1(), ",root2=", q.getRoot2())


main()

